import React from "react"
import './index.scss'
export default (props)=>{
        const {productTitle,unit,amount,addressDetail,productPics} = props.dataSource
        const pictureArray = productPics?.split(',')||[]
        let renderPicture = !!pictureArray?pictureArray[0]:''
        return <div className='supply-item' onClick={props.onClick}>
                <div className="picture">
                        <img src={renderPicture} alt=""/>
                </div>
                <div className="desc">
                        <div className="name">{productTitle}</div>
                        <div className="price">
                                <span className="tag">供</span>
                                <span className="count">￥{amount}元/{['','公斤','吨'][unit]}</span>
                        </div>
                        <div className="address">{addressDetail}</div>
                </div>
        </div>
}
